package MyGui;


import javax.swing.*;
import java.awt.*;

public class AboutDlg extends JDialog {
    private static final int GAP = 12;

    public AboutDlg(Frame owner) {
        super(owner, "About PDO", true);
        setLocation(200, 200);
        setSize(510,300);
        Container contentPane = getContentPane();
        contentPane.setLayout(MyDlgFrame.gridBagLayout);
        contentPane.setBackground(Color.white);

        // Initialize components
        JLabel[] labels = new JLabel[] {
            new JLabel("Copyright (c) 2001-2002 ABB Inc. All Rights Reserved."),
            new JLabel("ABB Inc."),
            new JLabel("940 Main Campus Drive, Suite 300"),
            new JLabel("Raleigh, NC 27606")
        };
        Font font = new Font("Serif", Font.PLAIN, 16);
        for (int i = 0; i < labels.length; i++) {
            labels[i].setFont(font);
            labels[i].setForeground(Color.black);
        }

        // Construct panel
        GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 100, 0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
            new Insets(GAP, GAP, GAP, GAP), 0, 0);
        contentPane.add(new JLabel(new ImageIcon(getClass().getClassLoader().
            getResource("Graphics/Logo.gif"))), gbc);

        gbc.gridy = 1; gbc.weighty = 100; gbc.fill = GridBagConstraints.NONE;
        contentPane.add(labels[0], gbc);

        gbc.weighty = 0; gbc.insets.top = gbc.insets.bottom = 0;
        for (int i = 1; i < labels.length; i++) {
            gbc.gridy = i+1;
            if (i == labels.length-1)
                gbc.insets.bottom = GAP;
            contentPane.add(labels[i], gbc);
        }
    }
}